home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Resources / Burning & Media / GB-PVR 1.2.13 / GBPVR10213.msi / Cabs.w1.cab / GuideListing.cs653 < prev    next >
Text File  |  2007-02-14  |  5KB  |  138 lines

  1. using System;
  2. using System.Collections;
  3. using System.Text;
  4. using System.Web;
  5.  
  6. /// <summary>
  7. /// This class is used to create the guide listing.
  8. /// </summary>
  9. namespace gbweb.classes
  10. {
  11.     public class GuideListing
  12.     {
  13.         private GuideListingDiv Div;
  14.         private GuideListingLine Line;
  15.         private GuideListingChannel Channel;
  16.         private GuideListingShowTimes Showtimes;
  17.         private StringBuilder Lines;
  18.         private string divHold = string.Empty;
  19.         private HttpResponse response;
  20.  
  21.         public GuideListing(HttpResponse Response)
  22.         {
  23.             Div = new GuideListingDiv();
  24.             Line = new GuideListingLine();
  25.             Channel = new GuideListingChannel();
  26.             Showtimes = new GuideListingShowTimes();
  27.             Lines = new StringBuilder();
  28.             response = Response;
  29.         }
  30.  
  31.         public GuideListing(HttpResponse Response, GuideListingShowTimes showtimes, GuideListingDiv div, GuideListingLine line,GuideListingChannel channel)
  32.         {
  33.             Showtimes = showtimes;
  34.             Div = div;
  35.             Line = line;
  36.             Channel = channel;
  37.             Lines = new StringBuilder();
  38.             response = Response;
  39.         }
  40.  
  41.         public string getGuide()
  42.         {
  43.             //string returnLine = string.Empty;
  44.             //for (int i = 0; i < Lines.Count; i++ )
  45.             //{
  46.             //    returnLine += Lines[i]+ "\n";
  47.             //    //response.Write(Lines[i]+ "\n");
  48.             //}
  49.             return Lines.ToString();
  50.         }
  51.  
  52.         public void addStartDivLine(string divId, string divClass)
  53.         {
  54.             GuideListingDiv div = new GuideListingDiv(divId, divClass);
  55.             Lines.Append(div.getStartDiv()+ "\n");
  56.         }
  57.  
  58.         public void addEndDivLine()
  59.         {
  60.             GuideListingDiv div = new GuideListingDiv();
  61.             Lines.Append(div.getEndDiv() + "\n");
  62.         }
  63.  
  64.         public void addShowtimesLineLeftCorner(int CornerWidth, bool ShowLeftScroll)
  65.         {
  66.             Showtimes.setCornerWidth(CornerWidth);
  67.             Lines.Append(Showtimes.getShowtimesCornerLine(ShowLeftScroll) + "\n");
  68.         }
  69.  
  70.         public void addShowtimesLine(int ShowtimeMargin, int ShowtimeWidth, string ShowtimeTime)
  71.         {
  72.             Showtimes.setShowtimesMargin(ShowtimeMargin);
  73.             Showtimes.setShowtimesWidth(ShowtimeWidth);
  74.             Showtimes.setShowtimesTime(ShowtimeTime);
  75.             Lines.Append(Showtimes.getShowtimesLine() + "\n");
  76.         }
  77.  
  78.         //public void addShowtimesLine(GuideListingShowTimes showtimes, bool ShowLeftScroll)
  79.         //{
  80.         //    Lines.Append(showtimes.getShowtimesCornerLine(ShowLeftScroll) + "\n");
  81.         //    Lines.Append(showtimes.getShowtimesLine() + "\n");
  82.         //}
  83.         
  84.         public void addDisplayLine(string DisplayClass, int Margin, int Width, string ProgrammeInfo)
  85.         {
  86.             Line.setDisplayClass(DisplayClass);
  87.             Line.setDisplayMargin(Margin);
  88.             Line.setDisplayWidth(Width);
  89.             Line.setProgrammeInfo(ProgrammeInfo);
  90.             Lines.Append(Line.getDisplayLine() + "\n");
  91.         }
  92.  
  93.         public void addDisplayLine(GuideListingLine line)
  94.         {
  95.             Lines.Append(line.getDisplayLine());
  96.         }
  97.  
  98.         public void addDisplayChannel(string DisplayClass, string DisplayTitle, int displayWidth, string chnlHref, 
  99.                                       string chnlNumber, string chnlName, string ChannelLogoHref, string ChannelLogoImgSrc)
  100.         {
  101.             Channel.setDisplayClass(DisplayClass);
  102.             Channel.setDisplayTitle(DisplayTitle);
  103.             Channel.setDisplayWidth(displayWidth);
  104.             Channel.setChannelHref(chnlHref);
  105.             Channel.setChannelName(chnlName);
  106.             Channel.setChannelNumber(chnlNumber);
  107.             Channel.setChannelLogHref(ChannelLogoHref);
  108.             Channel.setChannelLogoImgSrc(ChannelLogoImgSrc);
  109.  
  110.             Lines.Append(Channel.getChannelLine() + "\n");
  111.         }
  112.  
  113.         public void addDisplayChannel(GuideListingChannel channel)
  114.         {
  115.             Lines.Append(channel.getChannelLine() + "\n");
  116.         }
  117.  
  118.         public void InitializeListingLine()
  119.         {
  120.             Line = new GuideListingLine();
  121.         }
  122.  
  123.         public void InitializeChannelLine()
  124.         {
  125.             Channel = new GuideListingChannel();
  126.         }
  127.  
  128.         public void Initailize()
  129.         {
  130.             Showtimes = new GuideListingShowTimes();
  131.             Div = new GuideListingDiv("", "");
  132.             Line = new GuideListingLine();
  133.             Channel = new GuideListingChannel();
  134.             Lines = new StringBuilder();
  135.         }
  136.     }
  137. }
  138.